﻿
Imports std
Imports storoomc
Imports storcore

Public Class nodes_redundance3
    Inherits nodes_redundance2

    Private Shared Function c(ByVal si As storageInterface) As storoomTalk
        Return convertor.cast(Of storoomTalk)(si)
    End Function

    Protected Overrides Function storageInterfaceRead(ByVal si As storageInterface, ByVal key As String, _
                                                      ByRef buff As bytes, ByRef ts As Int64) As Boolean
        Return c(si).tsRead(key, buff, ts)
    End Function

    Protected Overrides Function storageInterfaceWrite(ByVal si As storageInterface, ByVal key As String, _
                                                       ByVal buff As bytes, ByVal ts As Int64) As Boolean
        Return c(si).tsWrite(key, buff, ts)
    End Function

    Protected Overrides Function storageInterfaceModify(ByVal si As storageInterface, ByVal key As String, _
                                                        ByVal buff As bytes, ByVal ts As Int64) As Boolean
        Return c(si).tsModify(key, buff, ts)
    End Function

    Protected Overrides Function storageInterfaceSeek(ByVal slice As storageInterface, ByVal key As String) As Boolean
        Return c(slice).tsSeek(key)
    End Function

    Protected Overrides Function storageInterfaceList(ByVal slice As storageInterface,
                                                      ByVal arg As vector(Of String)) As Boolean
        Return c(slice).tsList(arg)
    End Function

    Protected Overrides Function storageInterfaceDelete(ByVal si As storageInterface, ByVal key As String) As Boolean
        Return c(si).tsDelete(key)
    End Function

    Protected Overrides Function storageInterfaceSizeof(ByVal si As storageInterface,
                                                        ByVal key As String,
                                                        ByRef size As UInt64) As Boolean
        Return c(si).tsSizeof(key, size)
    End Function

    Protected Overrides Function storageInterfaceKeyCount(ByVal si As storageInterface,
                                                          ByRef count As UInt64) As Boolean
        Return c(si).tsKeyCount(count)
    End Function
End Class
